package com.tony.blog.model.mapper;

import com.tony.blog.model.entity.UserMsg;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: UserMsgMapper
 * @Auther: 皮蛋布丁
 * @Date: 2021/09/05/21:06
 * @Description: 用户消息盒子
 */
public interface UserMsgMapper {

    /**
    * @Description: insertSelective 个人消息服务记录
    * @Param: [record]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/9/20 20:13
    */
    Integer insertSelective(UserMsg record);

    /**
    * @Description: selectByModuleUIdsRead 获取个人消息列表
    * @Param: [moduleCode, uId, isRead]
    * @return: java.util.List<com.tony.blog.model.entity.UserMsg>
    * @Author: 皮蛋布丁
    * @Date: 2021/9/23 20:53
    */
    List<UserMsg> selectByModuleUIdsRead(@Param("moduleCode") String moduleCode,@Param("uId") Integer uId,
                                         @Param("isRead") Integer isRead);

    /**
    * @Description: countModuleUIdIsRead 获取未读信息的条数
    * @Param: [moduleCode, uId, isRead]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/9/23 21:05
    */
    Integer countModuleUIdIsRead(@Param("moduleCode") String moduleCode,@Param("uId") Integer uId,
                                 @Param("isRead") Integer isRead);

    /**
    * @Description: selectByPrimaryKey 根据id获取消息
    * @Param: [id]
    * @return: com.tony.blog.model.entity.UserMsg
    * @Author: 皮蛋布丁
    * @Date: 2021/9/26 21:47
    */
    UserMsg selectByPrimaryKey(Integer id);

    /**
    * @Description: updateByPrimaryKey 更新消息
    * @Param: [record]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/9/26 21:51
    */
    Integer updateByPrimaryKey(UserMsg record);
}
